//
//  partyPacket.h
//  Wi-Fi Party remade-1
//
//  Created by Vieta Ken on 2021/4/23.
//

#import <Foundation/Foundation.h>
#import <netinet/in.h>
#import <arpa/inet.h>
#import <sys/socket.h>
#import "config.h"

struct header{
    char partypacket_string[12];
    uint version_number;
    unsigned long long packet_number;
};




NS_ASSUME_NONNULL_BEGIN

@interface partyPacket : NSObject{
    signed char* send_content;
    struct header* header;
    long length;
    bool self_allocated;
}
-(void)dealloc;
-(id)init:(long)length;
-(id)init:(long)length received:(signed char*)buffer;
-(void)send:(int)socket toAddr:(struct sockaddr_in *)address;
-(signed char *)getPayloadAddr;
-(unsigned long long *)getPacketNumber;
-(long)getLength;
-(void)setNumber:(unsigned long long)packet_number;

@end

NS_ASSUME_NONNULL_END
